<!DOCTYPE html>
<html>
<body>
<h1>登录页面</h1>
<form id="login" action="./index.php" method="post">
    name:<br>
    <input type="text" name="username" value=""/>
    <br>
    pwd:<br>
    <input type="text" name="pwd" value=""/>
    <br><br>
    <input type="submit" value="Submit">
</form>

<?php
/**
 * Date: 2019/10/20
 * Time: 9:38
 */

$username = isset($_POST['username'])? $_POST['username'] : '';
$pwd      = isset($_POST['pwd'])? $_POST['pwd'] : '';

echo "用户名：" . $_POST['username'] . '<BR/>';
echo "密码：" . $_POST['pwd'] . '<BR/>';

if(!empty($_POST)) {
    if ($username = "wangkun" && $pwd == "123456") {
        echo "登录成功！";
    } else {
        echo "登录失败！";
    }
}

?>


</body>
</html>

